In a data processing system such as a workstation or personal computer, an input/output (IO) adapter such as a SCSI controller may be present as an interface device that is located between a peripheral device, e.g., a disk drive, and an IO bus of the workstation or personal computer for connection with the peripheral device. When an IO operation such as reading some data into a host processor of the data processing system from the disk drive is completed, an interrupt may be generated by the IO adapter. An interrupt is an IO adapter's request for attention from the host processor. When the host processor receives an interrupt, the host processor suspends its current operations, saves the status of its work, and transfers control to a special routine known as an interrupt service routine (ISR). An ISR contains the instructions for dealing with the particular situation that caused the interrupt. Interrupts may be generated by various hardware devices to request service or report problems, or by the host processor itself in response to program errors or requests for operating system services. Interrupts are the host processor's way of communicating with the active elements that comprise a data processing system.
In processing an interrupt, overhead is present which may reduce the processing efficiency of the data processing system. IO interrupt processing overhead typically includes (1) saving the application's current state, (2) executing the IO ISR, and then (3) restoring the application's state so execution may continue from where it was interrupted. ISR is a special routine that is executed upon an occurrence of a specific interrupt. Interrupts from different sources have different ISRs to carry out processes to handle the interrupt. These ISRs may include, for example, updating a system clock, or reading the keyboard. The occurrence of multiple IO interrupts increases the amount of overhead used to process these interrupts. This situation may decrease the efficiency of the data processing system, especially when many interrupts occur frequently.
In an attempt to alleviate the problem of excessive host processor utilization and overhead due to frequent interrupt generation, one conventional approach employs interrupt coalescing. In such an approach, groups of events (e.g. IO completion events, and the like) are stored or “coalesced”, and a single interrupt is generated once a selected number of the events are obtained. Instead of generating an interrupt each time an IO completion event occurs, an interrupt coalesced approach only generates an interrupt when, for example, five IO completion events have been coalesced. In such an approach, the host processor overhead associated with servicing IO completion events is reduced.
Although interrupt coalescing may reduce host processor utilization and overhead, the benefit of interrupt coalescing may nevertheless be marginalized with large IOs and may have a negative impact on performance when serialized IOs are the dominant IO load. A conventional approach used to solve these problems is to simply disable the interrupt coalescing feature entirely. However, with interrupt coalescing disabled, maximum performance of the adapter may not be achieved with small block data transfers, due to inefficient utilization of the data transfer mechanisms across the IO bus of the workstation or personal computer.
Therefore, it would be advantageous to have an apparatus and method for dynamically enabling and disabling interrupt coalescing in a data processing system so that maximum performance may be maintained and overall IO throughput may therefore be improved, regardless of differences in IO characteristics.